package com.example.demorabbitmq1.controller;


import com.example.demorabbitmq1.rabbit.order.cancel.queue.DelayForOrderCancelSender;
import com.example.demorabbitmq1.model.MsgForOrderCancel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * http://blog.battcn.com/2018/05/23/springboot/v2-queue-rabbitmq-delay/
 */

@RestController
@RequestMapping("")
public class DelayForOrderCancelController {

	@Autowired
	private DelayForOrderCancelSender delaySender;


	@RequestMapping(value = "/sendDelay", method = RequestMethod.POST)
	public String sendDelayMsg(@RequestBody MsgForOrderCancel msg) {



		delaySender.sendDelayMsg1(msg);

		return "success";

	}



}
